package com.liang.maogouyuyin.local.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.liang.maogouyuyin.bean.WeightBean

@Dao
interface WeightDao {
    @Insert
    suspend fun save(bean: WeightBean)

    @Delete
    suspend fun delete(bean: WeightBean)

    @Update
    suspend fun update(bean: WeightBean)

    @Query("select * from weight where name = :name order by date desc")
    suspend fun loadByName(name: String): List<WeightBean>
}